<template>
  <div class="home">
    <el-container>
      <el-header>
        <div class="zuo">
          <img src="../../assets/zhihui.jpg" />
          <div class="shou">
            <span @click="show" style='cursor:pointer;'>首页</span>
            <span>周末的晚霞</span>
          </div>
        </div>
        <div class="you">
          <el-dropdown trigger="click" class="sz">
      <span class="el-dropdown-link" style='cursor:pointer;'>
        设置
      </span>
      <el-dropdown-menu slot="dropdown" >
<el-dropdown-item v-for="(item,index) in $store.getters['topmenu']" :key="index.id">
  <i>{{item.name}}</i>
</el-dropdown-item>

      </el-dropdown-menu>
    </el-dropdown>
          <span @click="esc" style='cursor:pointer;'>退出登录</span>
        </div>
      </el-header>
      <el-container>
        <el-aside width="100px" class="zuo">
          <Left></Left>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Left from './Left.vue'
export default {
  components: { Left },
  name: 'homeV',
  data () {
    return {}
  },
  methods: {
    esc () {
      this.$router.push('/login')
    },
    show () {
      this.$router.push('/home')
    }
  }
}
</script>

<style lang="less" scoped>
html,
body {
  width: 100%;
  height: 100%;
}
.el-header {
  width: 100%;
  height: 50px;
  display: flex;
  background: #f4f4f4;
  justify-content: space-between;
  line-height: 50px;
  .zuo {
    img {
      width: 130px;
      height: 30px;
      margin: 10px 25px 0 0;
      float: left;
    }
    .shou {
      width: 274px;
      float: left;
      span {
        margin-right: 10px;
      }
    }
    // width: 1450px;
  }
  .you {
    width: 200px;
    .sz {
      margin-right: 60px;
    }
  }
}
.el-dropdown-menu{
  margin-top: -10px;
  // margin-left: 0px;
}
</style>
